<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>P21第二题</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  	<style>
  		table{
  			border:3px solid black;
  			width:500px;
  			border-collapse:collapse;
  		}
  		 td{
         	border-right:1px solid black;
         	border-bottom:1px solid black;
         }
  	</style>
  
  </head>
  
  <body>
  	<%
		class Student{
			int sno;
			String sname;
			String sex;
			int cno;
			int grade;
			Student(int sno,String sname,String sex,int cno, int grade){
				this.sno = sno;
				this.sname = sname;
				this.sex = sex;
				this.cno = cno;
				this.grade = grade;
			}
		}
		ArrayList<Student> u = new ArrayList();
		u.add(new Student(1,"李白","男",1,723));
		u.add(new Student(2,"孟浩然","男",2,689));
		u.add(new Student(3,"杨玉环","女",3,600));
	%>
	<table>
		<tr>
			<td>学号</td>
			<td>姓名</td>
			<td>性别</td>
			<td>班级</td>
			<td>成绩</td>
		</tr>
		<tr>
			<td>0<%=u.get(0).sno %></td>
			<td><%=u.get(0).sname %></td>
			<td><%=u.get(0).sex %></td>
			<td>00<%=u.get(0).cno %></td>
			<td><%=u.get(0).grade %>.0</td>
		</tr>
		<tr>
			<td>0<%=u.get(1).sno %></td>
			<td><%=u.get(1).sname %></td>
			<td><%=u.get(1).sex %></td>
			<td>00<%=u.get(1).cno %></td>
			<td><%=u.get(1).grade %>.0</td>
		</tr>
		<tr>
			<td>0<%=u.get(2).sno %></td>
			<td><%=u.get(2).sname %></td>
			<td><%=u.get(2).sex %></td>
			<td>00<%=u.get(2).cno %></td>
			<td><%=u.get(2).grade %>.0</td>
		</tr>
	</table>
  </body>
</html>
